// @ts-ignore
/* eslint-disable */
import { request } from 'umi';

/** 获取 账号 POST */
export async function pageAccount(options?: { [key: string]: any }) {
  return request<BaseResponseBean.responsePage<AdminAccountData.Account[]>>('/admin/account/page', {
    method: 'POST',
    data: options || {},
  });
}

/** 获取 权限 树 POST */
export async function treePermissionForAccountId(options?: { [key: string]: any }) {
  return request<BaseResponseBean.responsePage<AdminPermissionData.Permission[]>>(
    '/admin/account/tree/permission',
    {
      method: 'POST',
      data: options || {},
    },
  );
}

/** 保存 账号 POST */
export async function saveAccount(options?: { [key: string]: any }) {
  return request<BaseResponseBean.response<AdminAccountData.Account>>('/admin/account/save', {
    method: 'POST',
    data: options || {},
  });
}

/** 编辑 账号 POST */
export async function updateAccount(options?: { [key: string]: any }) {
  return request<BaseResponseBean.response<AdminAccountData.Account>>('/admin/account/update', {
    method: 'POST',
    data: options || {},
  });
}

/** 删除 账号 POST */
export async function deleteAccount(options?: { [key: string]: any }) {
  return request<BaseResponseBean.response<null>>('/admin/account/delete', {
    method: 'POST',
    data: options || {},
  });
}

/** 重置 账号 微信 POST */
export async function resetAccountBindWeChat(options?: { [key: string]: any }) {
  return request<BaseResponseBean.response<null>>('/admin/account/reset', {
    method: 'POST',
    data: options || {},
  });
}

/** 重置 账号 微信 POST */
export async function listAccountOrganization(options?: { [key: string]: any }) {
  return request<BaseResponseBean.response<AdminAccountData.AccountOrganization[]>>(
    '/admin/account/organization/list',
    {
      method: 'POST',
      data: options || {},
    },
  );
}
